# -*- coding = utf-8 -*-
#@Time: 2020/10/23 10:20
#@Author: 卜白
#@File: settings.py
#@Software: PyCharm

import os
class Config:
    DEBUG = True
    # mysql+pymysql://user:password@hostip:port/databasename
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:cjs122374@127.0.0.1:3306/spider_flask'
    # 去除警告
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_ECHO = True
    # secret_key
    SECRET_KEY = 'cjs122374'    # session底层封装的key值，键固定，值随意定义

    # 项目路径
    BASE_DIR = os.path.dirname(os.path.abspath(__file__))   # abspath绝对路径
    # static静态文件夹的路径
    STATIC_DIR = os.path.join(BASE_DIR, 'static')
    TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
    # 头像的上传目录
    UPLOAD_ICON_DIR = os.path.join(STATIC_DIR, 'upload/icon')
    # 相册的上传目录
    UPLOAD_PHOTO_DIR = os.path.join(STATIC_DIR, 'upload/photo')


class DevelopmentConfig(Config):
    ENV = 'development'  # 环境development

class ProductionConfig(Config):
    ENV = 'production'
    DDEBUG = False

if __name__ == '__main__':
    print(Config.UPLOAD_ICON_DIR)